Add "Plan first vs Migrate now" step to migrate - #2
Draft
claude[bot] wants to merge 1 commit into
Draft
Conversation
The migrate command now asks how to migrate before running: "Plan first" (the new default) or "Migrate now" (the existing end-to-end behavior). The "how far?" (full / paywalls) scope select is unchanged and applies to both. Plan first is a read-only pass: a new migrate-plan action runs the agent with READ capabilities to produce a step-by-step migration plan as its report, the CLI writes that report to sw-migration.md at the project root, and copies "implement the plan at sw-migration.md" to the clipboard so the user can run it through their own agent. The plan-generation instructions live in the new prompts/actions/migrate-plan.xml, reusing the superwall-migrate skill and provider reference; TypeScript holds no domain expertise. A --plan flag makes plan mode reachable non-interactively (default without it stays "migrate now"). Help, README, and the print-skill switch are updated to match.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Jake Mor · Slack thread
This is Christo Todorov's feature; he greenlit the UX in the Slack thread above.
Before / After
Before — running
npx superwall migratedetects your provider and then goes straight into a one-shot, end-to-end full migration: the agent edits your app source in place.After —
migratefirst asks how you want to migrate:sw-migration.mdat your project root and copiesimplement the plan at sw-migration.mdto your clipboard, so you can review the plan and then run it through your own agent when you're ready. No source files are touched.The existing "how far?" scope select (Full migration / Paywalls only) is unchanged and still runs in both modes.
How
src/commands/migrate.ts— a new modeselect("Plan first" / "Migrate now") runs right after the provider is detected, gated onctx.interactive && !dryRun, defaulting the highlight to Plan first. The "how far?" select is kept as-is after it. The plan branch runs the new action, writes the returned report to<app>/sw-migration.md(root, not.superwall/), copies the run-prompt to the clipboard, and shows its own next-steps/outro.migrate-planaction (src/core/agent/actions.ts) with READ capabilities, so Plan first is provably non-destructive — the agent cannot edit app source. It reuses the samesuperwall-migrateskill + provider reference and the samefull/paywallsscope vars asmigrate(sharedmigrateVars).prompts/actions/migrate-plan.xml— instructs the agent to produce/return a complete, codebase-specific migration plan as its report and to modify no files; the CLI persists it. Mirrorsmigrate.xml,outputMode: "report".implement the plan at sw-migration.mdviacopyToClipboard, mirroringcopyIntegrationPrompt's UX inintegrate/agent.ts(success note + manual-copy fallback).--planflag (yargs) makes plan mode reachable non-interactively, threaded like--dry-run. Without it, non-interactive default stays migrate now.printHelp()insrc/cli.tsdocumentsmigrate [--plan],README.md's migrate section describes the new flow, and theprint-skillswitch handles the new action id.Verification
bun run buildsucceeds;bun run typecheckclean;bun run testgreen (81/81).Follow-up
The bundled
superwall-migrateskill is reused unchanged, so no skill content changed here. If the plan-first flow is later documented in the public superwall/skills repo's workflow router, a follow-up sync there may be needed — out of scope for this PR.Generated by Claude Code